Ext.define('DCApp.view.attach.Detail', {
    extend: 'DCApp.view.Detail',
    alias: 'widget.CeAttachmentdetail',
    bind: {
        title: '附件 - 【{theObj.id}】'
    },
    componentCls: 'attach-detail',
    controller: 'attachdetail',
    
    
    items: [{
    	listeners: {
		  render: function(p){
			p = p.getEl();
			var me= this.up();
			me.h0=p.getHeight();
		    p.on('scroll', function(e, t){
		    	//console.log(t.scrollTop +"   "+ t.clientHeight);
		    	me.onscroll(t.scrollTop,t.clientHeight);
		    }, p);
		  }
		},
    	title: 'Panel 0',
        flex: 2,
        frame: false,
        xtype: 'container',
        layout: 'anchor',
        style: {
            overflow: 'auto'
        },
        items: [
                {
                    title: '附件信息',
                    margin: '0 0 10 0',
                    cls:'nav_pos',
                    bodyPadding: 10,
                    fieldDefaults: {
                        labelAlign: 'right',
                        labelWidth: 100,
                        padding:3
                    },
                    defaults: {
                        anchor: '100%'
                    },
                    xtype: 'form',
                    reference: 'form',
                    items: [{
                        xtype: 'container',
                        layout: 'hbox',
                        combineErrors: true,
                        defaultType: 'textfield',
                        items: [{
							flex: 2,
                            fieldLabel: '序号',
                            xtype: 'displayfield',
                            bind: '{theObj.id}'
							},DCApp.Cfg.getEditorField('登记人','{theObj.dcEditor0}')]
                    }, {
                        xtype: 'container',
                        layout: 'hbox',
                        combineErrors: true,
                        defaultType: 'textfield',
                        items: [{
                        flex: 2,
                        xtype: 'textfield',
                        fieldLabel: '题名',
                        allowBlank: false,
                        bind: '{theObj.name}'
                    }, {
                    	flex: 2,
                        xtype: 'textfield',
                        fieldLabel: '英文题名',
                        //allowBlank: true,
                        bind: '{theObj.nameUk}'
                    
                    }]
                    },
                    {
                        xtype: 'container',
                        layout: 'hbox',
                        combineErrors: true,
                        defaultType: 'textfield',
                        items: [{
                       	flex: 2,
                        xtype: 'displayfield',
                        height:'auto!important',
                        fieldLabel: '文件后缀',
                         bind: '{theObj.suffix}'
                    }, {
                    	 flex: 2,
                        xtype: 'displayfield',
                        fieldLabel: '文件大小',
                        //allowBlank: false,
                        bind: '{theObj.filesize}'
                    
                    }]
                    },
                    {
                        xtype: 'container',
                        layout: 'hbox',
                        combineErrors: true,
                        defaultType: 'textfield',
                        items: [{
                        flex: 2,
                        xtype: 'textfield',
                        fieldLabel: '用途',
                        //allowBlank: false,
                        bind: '{theObj.purpose}'
                    }, {
                    	 flex: 2,
                        xtype: 'textfield',
                        fieldLabel: '规格',
                        //allowBlank: false,
                        bind: '{theObj.spec}'
                       
                    }]
                    },
                    
                    {

                        xtype: 'container',
                        layout: 'hbox',
                        combineErrors: true,
                        defaultType: 'textfield',
                        items: [
                                DCApp.Cfg.getUserField('初审','{theObj.dcEditor1}'),
                                DCApp.Cfg.getUserField('终审','{theObj.dcEditor2}')
                              ]
                     },	
                    {
                       	flex: 4,
                        xtype: 'fileupload',
                        height:'auto',
                        fieldLabel: '附件上传',
                        entity_to:'CeAttachment',
                        bind: {
                       	 value:'{theObj.path}',
                       	 entity_id:'{theObj.id}' 
                        }
                    }]
                }
            ]
        }]
});
